/****************************************************************************
**
** OptionsGump.h
**
** Copyright (C) August 2014 Hotride
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
*****************************************************************************
*/
//---------------------------------------------------------------------------
#ifndef OptionsGumpH
#define OptionsGumpH
//--------------------------------------------------------------------------
const float g_SphereListWidth = 88.0f;
//---------------------------------------------------------------------------
class TOptionsGump
{
private:
	short m_X;
	short m_Y;
	short m_Page;

	TEXT_TEXTURE_HEADER m_TexturePage1[8];	//Sound and Music
	TEXT_TEXTURE_HEADER m_TexturePage2[8];	//Pop-up Help
	TEXT_TEXTURE_HEADER m_TexturePage3[6];	//Language
	TEXT_TEXTURE_HEADER m_TexturePage4[19];	//Chat
	TEXT_TEXTURE_HEADER m_TexturePage5[2];	//Macro Options
	TEXT_TEXTURE_HEADER m_TexturePage6[8];	//Interface
	TEXT_TEXTURE_HEADER m_TexturePage7[12];	//Display
	TEXT_TEXTURE_HEADER m_TexturePage8[9];	//Reputation System
	TEXT_TEXTURE_HEADER m_TexturePage9[9];	//Miscellaneous
	TEXT_TEXTURE_HEADER m_TexturePage10[2];	//Filter Options
	
	int DrawPage1(bool mode, DWORD Index, bool IsPressed, int CanSelectedButton, int CanPressedButton, int PosX, int PosY); //Sound and Music
	int DrawPage2(bool mode, DWORD Index, bool IsPressed, int CanSelectedButton, int CanPressedButton, int PosX, int PosY); //Pop-up Help
	int DrawPage3(bool mode, DWORD Index, bool IsPressed, int CanSelectedButton, int CanPressedButton, int PosX, int PosY); //Language
	int DrawPage4(bool mode, DWORD Index, bool IsPressed, int CanSelectedButton, int CanPressedButton, int PosX, int PosY); //Chat
	int DrawPage5(bool mode, DWORD Index, bool IsPressed, int CanSelectedButton, int CanPressedButton, int PosX, int PosY); //Macro Options
	int DrawPage6(bool mode, DWORD Index, bool IsPressed, int CanSelectedButton, int CanPressedButton, int PosX, int PosY); //Interface
	int DrawPage7(bool mode, DWORD Index, bool IsPressed, int CanSelectedButton, int CanPressedButton, int PosX, int PosY); //Display
	int DrawPage8(bool mode, DWORD Index, bool IsPressed, int CanSelectedButton, int CanPressedButton, int PosX, int PosY); //Reputation System
	int DrawPage9(bool mode, DWORD Index, bool IsPressed, int CanSelectedButton, int CanPressedButton, int PosX, int PosY); //Miscellaneous
	int DrawPage10(bool mode, DWORD Index, bool IsPressed, int CanSelectedButton, int CanPressedButton, int PosX, int PosY); //Filter Options

	void DrawTextTexture(TEXT_TEXTURE_HEADER &th, int X, int Y);

	void ApplyPageChanges();

public:
	TOptionsGump() {}
	~TOptionsGump() {}
	
	TEntryText *m_TextEntryX;
	TEntryText *m_TextEntryY;
	TEntryText *m_TextEntryMacro;

	TConfigManager m_Config;

	void Init();

	void Release();
	
	SETGET(short, X)
	SETGET(short, Y)
	SETGET(short, Page)
	
	int Draw(bool mode, TGump *gump);

	void GenerateFrame(TGump *gump, float PosX, float PosY);

	void OnClose(TGump *gump);
	void OnButtonUp(TGump *gump);
	void OnCharPress(TGump *gump, WPARAM wparam, LPARAM lparam);
	void OnKeyPress(TGump *gump, WPARAM wparam, LPARAM lparam);
};
//---------------------------------------------------------------------------
#endif